// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.linqingying.gitcode.tasks;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.project.Project;
import com.intellij.tasks.TaskRepository;
import com.intellij.tasks.TaskState;
import com.intellij.tasks.config.TaskRepositoryEditor;
import com.intellij.tasks.impl.BaseRepositoryType;
import com.intellij.util.Consumer;
import com.linqingying.gitcode.icons.GitCodeIcons;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.EnumSet;

final class GitCodeRepositoryType extends BaseRepositoryType<GitCodeRepository> {
  @NotNull
  @Override
  public String getName() {
    return "GitCode";
  }

  @NotNull
  @Override
  public Icon getIcon() {
    return   GitCodeIcons.GIT_CODE_ICON;
  }

  @NotNull
  @Override
  public TaskRepository createRepository() {
    return new GitCodeRepository(this);
  }

  @Override
  public Class<GitCodeRepository> getRepositoryClass() {
    return GitCodeRepository.class;
  }

  @NotNull
  @Override
  public TaskRepositoryEditor createEditor(GitCodeRepository repository,
                                           Project project,
                                           Consumer<? super GitCodeRepository> changeListener) {
    return new GitCodeRepositoryEditor(project, repository, changeListener);
  }

//  @Override
//  public EnumSet<TaskState> getPossibleTaskStates() {
//    return EnumSet.of(TaskState.OPEN, TaskState.RESOLVED);
//  }

}
